<!--
Auteur: Frank den Broeder && Jeroen van Dijk
Stundentnummer: s1049444//
Klas: IS1d
-->
<?php
include ($_SERVER['DOCUMENT_ROOT'].'/config/connect.php');

session_start();
if (!(isset($_SESSION['login']) && $_SESSION['login'] != '')){
header ("Location: /index.php?page=beheer");
exit;
}

if(isset($_POST['Uitloggen'])){
    session_start();
    session_destroy();
    header ("Location: /index.php?page=beheer");
    exit;
}


if ((isset($_SESSION['login']) && ($_SESSION['login'] != ''))){
    $user = $_SESSION['username'];
    $sql = mysql_query("SELECT * FROM gebruiker WHERE username='$user'");
    $groupid = mysql_fetch_assoc($sql);
    if ($groupid['group_id'] == 4){
        $naam = mysql_query("SELECT naam, achternaam FROM student WHERE studentnummer='$user'");
    
    print('Welkom'. $naam .'!'. '<br>');
    print('<a href="/index.php?page=evenementen">Klik hier voor informatie over de Evenementen</a><br>');
    print('<a href="/index.php?page=verenigingen">Klik hier voor informatie over de Verenigingen</a><br>');
    print('<a href="/index.php?page=studentprofiel">Klik hier voor je profiel</a><br>');
    }
    elseif($groupid['group_id'] <= 2){

        print('<SPAN CLASS="text_h1">Beheer</SPAN>');
        print('<SPAN CLASS="text_normal"> <BR><BR>');
        print('<a href="index.php?page=managerapport">Rapportages</a><br>');
        print('<BR><a href="index.php?page=catrapport">Evenement Catogorie Aanpassen</a>');    
        print('</SPAN>');
     }
 }
if ((isset($_SESSION['login']) && $_SESSION['login'] != '')){
    print('<form action="/module/beheer/beheerwheninlogcomplete.php" method="post">
    <BR><input type="submit" name="Uitloggen" value="Uitloggen" />
    </form>');   
}
?>
